<?php
/* @var $this CategorieController */
/* @var $model Categories */

$this->breadcrumbs=array(
	'Categories'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Categories', 'url'=>array('index')),
	array('label'=>'Create Categories', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#categories-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="content-box">
<div class="content-box-header">
        <h3>分类列表</h3>
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab">表单</a></li>
        </ul>
        <div class="clear"></div>
 </div>
 <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">


<?php 

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'categories-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'name',
		array(
			'name'=>'parent',
			'value' => 'Categories::model()->findParentName($data->parent)',
		),
		//'category_image_url',
		//'description',
		//'param',
		//'ordering',
		//array('header'=>'父分类', 'value' => 'Categories::model()->findParentName($data->parent)'),
		//array('header'=>'发布状态','type' => 'raw' , 'name' => 'published'),

		array(
			'header'=>'操作',
			'class'=>'CButtonColumn',
			'template'=>'{update} {delete}',
			'htmlOptions'=>array(
					'style'=>'text-align:center;  vertical-align:middle',
			),
			'buttons' => array(
				'update'=>array(
						'label'=>'更新',
						'url'=>'array("/backend/updatecategorie/$data->id")',
				),
				'delete'=>array(				
						'label'=>'删除',				
						'url'=>'array("/backend/delcategorie/$data->id")',								
				),
			),	
		),
	),
)); 

//var_dump($model->search());

?>

	</div>
</div>
</div>
